import { request } from '../../../services/request';

// 扫描工单接口
export const scanMesMBomKnifeClaimList = async (params: { qr_code: string }) => {
    console.log('扫描工单接口 - 提交参数:', params);
    try {
        const response = await request('app/mesMbomKnife/scanMesMBomKnifeClaimList', {
            method: 'POST',
            body: JSON.stringify(params)
        });
        console.log('扫描工单接口 - 返回结果:', response);
        return response;
    } catch (error) {
        console.error('扫描工单接口 - 调用失败:', error);
        throw error;
    }
};

// 领刀具接口
export const claimKnife = async (params: any[]) => {
    console.log('领刀具接口 - 提交参数:', params);
    try {
        const response = await request('app/mesMbomKnife/claim', {
            method: 'POST',
            body: JSON.stringify(params)
        });
        console.log('领刀具接口 - 返回结果:', response);
        return response;
    } catch (error) {
        console.error('领刀具接口 - 调用失败:', error);
        throw error;
    }
};
